package com.atlas.alpha;

import android.app.*;
import android.content.*;
import android.net.Uri;
import android.os.*;
import android.view.*;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SelectionScreen extends Activity {

	private Button btnArmsLeft;
	private Button btnArmsRight;
	private Button btnPecs;
	private Button btnAbs;
	private Button btnLegs;
	private Button btnScheduleWorkout;

	
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_selection_screen);
        //hook up refs to buttons
        btnArmsLeft = (Button)findViewById(R.id.btnArmsLeft);
        btnArmsRight = (Button)findViewById(R.id.btnArmsRight);
        btnPecs = (Button)findViewById(R.id.btnPecs);
        btnAbs = (Button)findViewById(R.id.btnAbs);
        btnLegs = (Button)findViewById(R.id.btnLegs);
    	btnScheduleWorkout = (Button)findViewById(R.id.btnScheduleWorkout);

        
        btnArmsLeft.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
            	//Intent iSeletion = new Intent(v.getContext(), SelectionScreen.class);
               // startActivityForResult(iSeletion, 0);
            	String url = "http://www.bodybuilding.com/fun/fivestararms.htm";
            	Intent i = new Intent(Intent.ACTION_VIEW);
            	i.setData(Uri.parse(url));
            	startActivity(i);
            }
        });

        btnArmsRight.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
            	//Intent iSeletion = new Intent(v.getContext(), SelectionScreen.class);
               // startActivityForResult(iSeletion, 0);
            	String url = "http://www.bodybuilding.com/fun/fivestararms.htm";
            	Intent i = new Intent(Intent.ACTION_VIEW);
            	i.setData(Uri.parse(url));
            	startActivity(i);
            }
        });
        
        btnPecs.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
            	//Intent iSeletion = new Intent(v.getContext(), SelectionScreen.class);
               // startActivityForResult(iSeletion, 0);
                String url = "http://www.bodybuilding.com/exercises/finder/lookup/filter/muscle/id/1/muscle/chest";
            	Intent i = new Intent(Intent.ACTION_VIEW);
            	i.setData(Uri.parse(url));
            	startActivity(i);
            }
        });

        btnAbs.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
            	//Intent iSeletion = new Intent(v.getContext(), SelectionScreen.class);
               // startActivityForResult(iSeletion, 0);
                String url = "http://www.bodybuilding.com/exercises/finder/lookup/filter/muscle/id/1/muscle/abdominals";
            	Intent i = new Intent(Intent.ACTION_VIEW);
            	i.setData(Uri.parse(url));
            	startActivity(i);
            }
        });
        
        btnLegs.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
            	//Intent iSeletion = new Intent(v.getContext(), SelectionScreen.class);
               // startActivityForResult(iSeletion, 0);
                String url = "http://www.bodybuilding.com/fun/legendary-legs-the-science-of-leg-training.html";
            	Intent i = new Intent(Intent.ACTION_VIEW);
            	i.setData(Uri.parse(url));
            	startActivity(i);
            }
        });
        
        btnScheduleWorkout.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
            	//change this to new sheduler activity
            	Intent iSeletion = new Intent(v.getContext(), SchedulerActivity.class);
                startActivityForResult(iSeletion, 0);
            }
        });
    }

    
    
    public void legWorkouts(View view) {
        Intent intent = new Intent(this, DisplayMessageActivity.class);
        startActivity(intent);
    }
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_selection_screen, menu);
        return true;
    }
}
